<!--  这一段是直接用了uview的官方例子，然后自己改改 -->
<template>
	<view>

		<view class="u-menu-wrap">
			<!-- 左边菜单 可滚动视图区域 -->
			<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view">
				<!-- tap.stop阻止冒泡 -->
				<view v-for="(item,index) in tabbar" :key="index" class='u-tab-item'
					:class="[current == index ? 'u-tab-item-active' : '']" @click="current=index">
					<text class="u-line-1">{{item.name}}</text>
				</view>
			</scroll-view>
			<!-- 右边菜单 可滚动视图区域 -->
			<scroll-view scroll-y scroll-with-animation class="right-box">
				<view style="width:540rpx; margin: 10rpx 10px;">
					<view class="name">基本参数</view>
					<t-table >
						<t-tr>
							<t-td class="list">
								<view style="margin-right: 120rpx;">车型</view>
								<view style="margin-left: 120rpx;">江淮VBS EV</view>
							</t-td>
						</t-tr>
						<t-tr>
							<t-td class="list">
								<view style="margin-right: 120rpx;">车型</view>
								<view style="margin-left: 120rpx;">江淮VBS EV</view>
							</t-td>
						</t-tr>
						<t-tr>
							<t-td class="list">
								<view style="margin-right: 120rpx;">车型</view>
								<view style="margin-left: 120rpx;">江淮VBS EV</view>
							</t-td>
						</t-tr>
					</t-table>
				</view>
				<view style="width:540rpx; margin: 10rpx 10px;">
					<view class="name">基本参数</view>
					<t-table >
						<t-tr>
							<t-td class="list">
								<view style="margin-right: 120rpx;">车型</view>
								<view style="margin-left: 120rpx;">江淮VBS EV</view>
							</t-td>
						</t-tr>
						<t-tr>
							<t-td class="list">
								<view style="margin-right: 120rpx;">车型</view>
								<view style="margin-left: 120rpx;">江淮VBS EV</view>
							</t-td>
						</t-tr>
						<t-tr>
							<t-td class="list">
								<view style="margin-right: 120rpx;">车型</view>
								<view style="margin-left: 120rpx;">江淮VBS EV</view>
							</t-td>
						</t-tr>
					</t-table>
				</view>
			</scroll-view>
		</view>
	</view>
</template>
<script>
	import tTable from '@/components/t-table/t-table.vue';
	import tTh from '@/components/t-table/t-th.vue';
	import tTr from '@/components/t-table/t-tr.vue';
	import tTd from '@/components/t-table/t-td.vue';
	export default {
		components: {
			tTable,
			tTh,
			tTr,
			tTd
		},
		data() {
			return {
				current: 0,
				tabbar: [{
						name: "电动",
						text: '2023',
						lists: [{
								name: "后驱"
							},
							{
								name: "前区"
							}
						]
					},
					{
						name: "气动",
						text: '2022',
						lists: [{
								name: "后驱1"
							},
							{
								name: "前区1"
							}
						]
					}
				],

			}
		},
		onLoad() {},
		onShow() {},
		onReady() {},

		mounted() {

		},
		methods: {}
	}
</script>

<style lang="scss" scoped>
	.u-search-box {
		padding: 18rpx 30rpx;
	}

	.u-menu-wrap {
		flex: 1;
		display: flex;
		overflow: hidden;
	}

	.u-search-inner {
		background-color: rgb(234, 234, 234);
		border-radius: 100rpx;
		display: flex;
		align-items: center;
		padding: 10rpx 16rpx;
	}

	.u-search-text {
		font-size: 26rpx;
		color: $u-tips-color;
		margin-left: 10rpx;
	}

	.u-tab-view {
		width: 250rpx;
		height: 100%;
	}

	.u-tab-item {
		position: relative;
		height: 110rpx;
		background: #f6f6f6;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 26rpx;
		color: #444;
		font-weight: 400;
		line-height: 1;
	}

	// 选中以后改变样式
	.u-tab-item-active {
		position: relative;
		color: #000;
		font-size: 29rpx;
		font-weight: 600;
		background: #fff;
	}

	// 在前面加一个竖条
	.u-tab-item-active::before {
		content: "";
		position: absolute;
		// border-left: 4px solid $u-type-primary;
		border-left: 3px solid #009ff0;
		height: 32rpx;
		left: 0;
		top: 39rpx;
	}

	.u-tab-view {
		height: 100%;
	}

	.right-box {
		height: 100vh;
		// background-color: rgb(250, 250, 250);
		background-color: #fff;
	}

	.page-view {
		// padding: 16rpx;
	}

	.class-item {
		margin-bottom: 10rpx;
		background-color: #fff;
		padding: 16rpx;
		border-radius: 8rpx;
	}

	.class-item:last-child {
		min-height: 100vh;
		// min-height: 500px;
	}

	.item-title {
		position: sticky;
		top: 0;
		font-size: 32rpx;
		padding: 5rpx 10rpx;
		font-size: 600;
		color: $u-main-color;
		background-color: #d4d4d4;
		z-index: 9990;

	}

	.item-menu-name {
		font-weight: normal;
		font-size: 26rpx;
		color: $u-main-color;
		line-height: 55rpx;
	}

	.item-container {
		display: flex;
		flex-wrap: wrap;
	}

	.list {}

	.thumb-box {
		width: 33.333333%;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		margin-top: 20rpx;
	}

	.item-menu-image {
		width: 120rpx;
		height: 120rpx;
	}

	.db_div {
		height: 80px;
		width: 100%;
		background-color: #fff;
		position: fixed;
		bottom: 0;
		/* 弹出层是10075 */
		z-index: 10075;
	}

	.db_div_show {
		height: 80px;
		width: 100%;
		background-color: #fff;
		position: fixed;
		bottom: 0;
	}

	.menuDetailDiv {
		display: flex;
		flex-direction: row;
		padding: 10rpx;
		margin: 10rpx 10rpx;
		height: 90rpx;
		font-size: 28rpx;
		border-bottom: #e6e6e6 solid 2rpx;
		/* justify-content: center;
        align-items: center; */
	}

	.name {
		font-size: 28rpx;
		font-weight: 600;
		margin: 10rpx;
	}
</style>